<?php

Route::group(['middleware' => ['web','auth:admin'], 'prefix' => 'shop', 'namespace' => 'Modules\Shop\Http\Controllers'], function()
{
    Route::get('/', 'CategoryController@index');
//    配置商品分类资源路由
    Route::resource("/category",'CategoryController');
});

//配置加载文章的路由
//article-route
Route::group(['middleware' => 'web','prefix'=>'shop','namespace'=>"Modules\Shop\Http\Controllers"],
    function () {
//        加载哪个标题的路由，看看模板有没有传参数
        Route::get('/lists/{cid}', 'HomeController@lists')->name('lists');
//        加载列表路由，点击哪个文章哪个文章显示内容
        Route::get('/contents/{aid}','HomeController@content')->name('contents');
        //加载博主置顶路由
        Route::get('/bozhu','HomeController@bozhu')->name('bozhu');
        //加载标签路由
        Route::get('/aboutme','HomeController@aboutme')->name('aboutme');
    });


 
//article-route
Route::group(['middleware' => ['web', 'auth:admin'],'prefix'=>'shop','namespace'=>"Modules\Shop\Http\Controllers"], 
function () {
    Route::resource('article', 'ArticleController')->middleware("permission:admin,resource");
});

//文章评论资源路由
Route::group(['middleware' => ['web'],'prefix'=>'shop','namespace'=>"Modules\Shop\Http\Controllers"],
    function () {
        Route::resource('comment', 'CommentController');
//        配置评论审核通过的路由
        Route::any('/ziji/{id}','CommentController@ziji')->name('ziji');
    });